﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace TimeAxis.Admin.Manager
{
    public partial class ProjectManager : System.Web.UI.Page
    {
        public List<Models.Category> categorys = new List<Models.Category>();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                DavidDB.ADO.DBManager dbmanager = new DavidDB.ADO.DBManager();
                Interfaces.ICategory iCategory = Impls.ImplCategory.GetInstance(dbmanager);
                categorys = iCategory.GetList();
                dbmanager.Commit();
                dbmanager.Dispose();
            }
        }
        protected void LoginButton_Click(object sender, EventArgs e)
        {
            DavidDB.ADO.DBManager dbmanager = new DavidDB.ADO.DBManager();
            Interfaces.ICategory iCategory = Impls.ImplCategory.GetInstance(dbmanager);
            Models.Category c = new Models.Category();
            c.CName = this.UserName.Text;
            iCategory.Insert(c);
            dbmanager.Commit();
            dbmanager.Dispose();
            Response.Redirect("ProjectManager.aspx");
        }
    }
}